// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements.  See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License.  You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* BlueprintCSS overrides */

/* Plugin Sidebar */
.bp3-tree-node-content {
  height: 40px;
  padding-left: 13px;
  padding-right: 0;
}

.bp3-tree-node-label {
  height: 100%;
}

.bp3-tree-node-caret {
  z-index: 1;
}

.bp3-tree-node-label {
  display: flex;
  align-items: center;
  padding-left: 3.35rem;
  margin-left: -3.015rem;
}

.bp3-tree {
  padding-left: 0px;
  margin-left: -20px;
  width: calc(100% + 40px);
}

/* Forms and inputs */
.bp3-tooltip .bp3-popover-arrow {
  margin-top: -2px;
}

.bp3-popover-wrapper,
.bp3-popover-target {
  width: 100%;
}

.bp3-form-helper-text {
  font-size: 11px !important;
  opacity: 0.8 !important;
  text-align: right;
}

.bp3-tag-input .bp3-button {
  position: absolute !important;
  right: 0;
  top: 0;
  bottom: 0;
}

/* Jira plugin tabs */
.bp3-tab-indicator {
  width: 8px;
  top: -3px;
  border-radius: 100%;
  height: 8px !important;
  left: -3px !important;
}

.bp3-tab {
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 0.1rem 0.5rem;
  outline: 0;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.bp3-tab-list {
  display: inline-block;
  max-width: 600px;
}

.bp3-running-text table, table.bp3-html-table {
  font-size: 1.0em;
}

button, .bp3-button {
  font-size: 1.1em;
}

.bp3-breadcrumbs {
  & > li {
    &::after {
      background: transparent url();
      background-size: contain;
      transform: scale(0.7);
      background-repeat: no-repeat;
      opacity: 0.3;
    }
  }
}

.bp3-toast-message {
  padding: 13px;
}

.bp3-toast {
  margin-left: 250px; // compensate for sidebar, toasts will appear centered
  background-color: #ffffff;
  &.bp3-intent-primary {
    background-color: #ffffff;
    color: #F0F4FE;
  }
  &.bp3-intent-warning {
    background-color: #ffffff;
    color: #94959F;
  }
  &.bp3-intent-danger {
    background-color: #ffffff;
    color: #E34040;
  }
  &.bp3-intent-success {
    background-color: #ffffff;
    color: #4DB764;
  }
  > span.bp3-icon {
    color: inherit !important;
    > svg {
      color: inherit !important;
    }
  }
}

.bp3-popover-wrapper {
  &.select-epic-key, &.select-story-key {
    width: auto;
    // min-width: 260px;
    max-width: 300px;
  }
}

.bp3-select-popover {
  .bp3-menu {
    max-height: calc(10 * 32px);
    overflow: auto;
  }
}

.bp3-multi-select-popover {
  .bp3-menu {
    max-height: calc(10 * 32px);
    overflow: auto;
  }
}

.bp3-multi-select-popover {
  max-width: 600px;
  overflow: auto;
  text-overflow: ellipsis;
  &.transformation-select-popover {
    max-width: 430px;
  }
  .bp3-menu-item {
    .bp3-menu-item-label {
      max-width: 70%;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }
  }
}

.bp3-menu-item {
  .bp3-control {
    margin-bottom: 0;
  }
}

.bp3-control.bp3-checkbox input:checked~.bp3-control-indicator:before {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0 0 12 5z' fill='rgba(255,255,255,1)'/%3E%3C/svg%3E")
}

.bp3-button.bp3-outlined.bp3-intent-primary {
  border-color: #7497F7;
}

.bp3-button.bp3-minimal.bp3-intent-primary,
.bp3-button.bp3-outlined.bp3-intent-primary {
  color: #7497F7;
}

.bp3-button.bp3-outlined.bp3-intent-primary:hover,
.bp3-button.bp3-outlined.bp3-intent-primary:active,
.bp3-button.bp3-outlined.bp3-intent-primary.bp3-active {
  color: #7497F7;
}

.bp3-card {
  &.bp3-elevation-0 {
    box-shadow: none;
  }
}

.bp3-button {
  .bp3-popover-wrapper {
    width: auto;
  }
}